public class Liczba	{
	public static void main(String[] args){
		if(args.length > 0)
			if( isNumber(args[0]) ){
				int dec = Integer.parseInt(args[0]);
				System.out.println("Hex = " + Integer.toHexString(dec));
				System.out.println("Oct = " + Integer.toOctalString(dec));
				System.out.println("Bin = " + Integer.toBinaryString(dec));
			}
			else{
				System.out.println("Error invalid integer");
			}
		else
			System.out.println("Error: you must enter in a number to convert");
	}

	public static boolean isInteger(String toCheck) {
		try	{
			Integer.parseInt(toCheck);
			return true;
		}
		catch (NumberFormatException nfe) {
			return false;
		}
	}
	public static boolean isNumber(String s)	{
		try	{
			Integer.parseInt(s);
			return true;
		}
		catch	(NumberFormatException nfe)	{
			return false;
		}
	}
}
